//
//  UIFont+add.m
//  GK
//
//  Created by Seven on 2018/12/19.
//  Copyright © 2018 Seven. All rights reserved.
//

#import "UIFont+add.h"

UIFont *defaultFontWithSize(CGFloat size){
    return MediumFontWithSize(size);
}

UIFont *RegularFontWithSize(CGFloat size){
    if (@available(ios 8.2, *)) {
        return [UIFont fontWithName:@"Helvetica-Light" size:size];
        //return [UIFont systemFontOfSize:size weight:UIFontWeightRegular];
    }else {
        return [UIFont systemFontOfSize:size];
    }
}

UIFont *MediumFontWithSize(CGFloat size){
    if (@available(ios 8.2, *)) {
        return [UIFont fontWithName:@"Helvetica" size:size];
        //return [UIFont systemFontOfSize:size weight:UIFontWeightMedium];
    }else {
        return [UIFont systemFontOfSize:size];
    }
}

UIFont *SemiboldFontWithSize(CGFloat size){
    if (@available(ios 8.2, *)) {
        return [UIFont fontWithName:@"Helvetica-Bold" size:size];
        //return [UIFont systemFontOfSize:size weight:UIFontWeightSemibold];
    }else {
        return BoldFontWithSize(size);
    }
}

UIFont *BoldFontWithSize(CGFloat size){
    return [UIFont fontWithName:@"Helvetica-Bold" size:size];
    //return [UIFont boldSystemFontOfSize:size];
}


UIFont *NumberFontWithSize(CGFloat size){
    return [UIFont fontWithName:@"DIN Alternate" size:size];
}

UIFont *NumberBoldFontWithSize(CGFloat size){
    return [UIFont fontWithName:@"DINAlternate-Bold" size:size];
}

UIFont *PingFangTCRegularFontWithSize(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"PingFangTC-Regular" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

UIFont *PingFangSCRegularFontWithSize(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"PingFangSC-Regular" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

UIFont *PingFangRegularFont(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"PingFangSC-Regular" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

UIFont *PingFangTCSemiboldFontWithSize(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"PingFangTC-Semibold" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

UIFont *PingFangSemiboFont(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"PingFangSC-Semibold" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

UIFont *PingFangTCMediumFontWithSize(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"PingFangTC-Medium" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

UIFont *ImpactFontWithSize(CGFloat size){
    UIFont *font = [UIFont fontWithName:@"Impact" size:size];
    if (font == nil) {
        font = [UIFont systemFontOfSize:size];
    }
    return font;
}

@implementation UIFont(add)

@end
